import request from '@/utils/request'


export  const  download_file = (code)=>
{
	let tokenId = sessionStorage.getItem('tokenId') 
	window.location.href=process.env.BASE_API+'/op/fileupload/download_file?fileCode='+code+'&token='+tokenId 
}

// 新增 意向客户联系信息
export const submitCustomerForm = (form)=> 
	request({
		url:'/op/intention_contact/create_intention_contact',
		method:'post',
		data:JSON.stringify(form)
	}) 

// 用户登录
export const login = (form)=> 
	request({
		url:'/auth/token',
		method: 'post',
        params:form
	})

export const login_of_mobile = (form)=> 
    request({
        url: '/auth/token_by_sms',
        method: 'post',
        params:{ 
            mobile:form.mobile,
            captchaCode:form.verifyCode
        } 
    })

// Olivia用户注册
export const register = (form)=>
	request({
		url:'/auth/olivia_register',
		method:'post',
		data:JSON.stringify(form)
	})
// 发送短信验证码
export  const  getVerifyCode = (mobile,smsType,captchaCode,requestCode)=>
	request({
		url:'/verify/send_sms_verify_code',
		method:'post',
		params:{
			mobile,
			smsType,
			captchaCode,
			requestCode
		}
	})